﻿@{
    Layout = "~/Views/Shared/_LayoutContent.cshtml";
}
@section css{
    <link href="~/ui/css/plugins/ztree/metroStyle/metroStyle.css" rel="stylesheet" />
    <style>
        .dropzmenu {
            display: none;
            z-index: 100;
            background-color: #eee;
            width: 80%;
            position: absolute;
        }
        .ztree {
            max-height: 200px;
            overflow: auto;
        }
    </style>
}
@section scripts{
    <script>seajs.use("@Url.Content("/src/sys/resource/js/show.js")");</script>
}
<div class="show-content" id="msapp">
    <div class="row pv10">
        @await Component.InvokeAsync("Menu",true)
    </div>
    <div class="row">
        <div class="ibox float-e-margins">
            <div class="ibox-content">
                <form class="form-horizontal m-t" id="form-resource">
                    <div class="form-group">
                        <label class="col-sm-3 control-label"><span class="red">*</span>菜单名称</label>
                        <div class="col-sm-8">
                            <input class="form-control required" type="text" name="ResourceName" v-model="resource.ResourceName">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">资源地址</label>
                        <div class="col-sm-8">
                            <input class="form-control" type="text" name="ResourceUrl" v-model="resource.ResourceUrl"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">父级菜单</label>
                        <div class="col-sm-8">
                            <div class="input-group">
                                <input type="text" class="form-control" readonly value="" id="menuselected" v-on:dblclick="selectMenu"/>
                                <span class="input-group-addon" v-on:click="clearMenu"><i class="fa fa-close"></i></span>
                                <span class="input-group-addon" v-on:click="selectMenu"><i class="fa fa-search"></i></span>
                            </div>
                            <div id="menuContent" class="dropzmenu">
                                <ul id="treeMenu" class="ztree"></ul>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">菜单图标</label>
                        <div class="col-sm-8">
                            <div class="input-group">
                                <input class="form-control" type="text" v-model="resource.Icon" readonly />
                                <span class="input-group-addon" v-on:click="clearIcon"><i class="fa fa-close"></i></span>
                                <span class="input-group-addon" v-on:click="selectIcon"><i class="fa fa-search"></i></span>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-6">
                            <label class="col-sm-6 control-label">显示到菜单</label>
                            <div class="col-sm-6">
                                <select class="form-control" v-model="resource.IsShow" name="IsShow">
                                    <option value="1">是</option>
                                    <option value="0">否</option>
                                </select>
                            </div>
                        </div>
                        <div class="col-sm-6">
                            <label class="col-sm-3 control-label">同级排序</label>
                            <div class="col-sm-7">
                                <input class="form-control required" type="number" name="Sort" min="0" v-model="resource.Sort" />
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">状态</label>
                        <div class="col-sm-8">
                            <input type="checkbox" v-bind:true-value="0" v-bind:false-value="1" v-model="resource.IsDel" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">按钮</label>
                        <div class="col-sm-8">
                            <label v-for="item in buttons" class="m-l-xs">
                                <input class="m-r-xs" type="checkbox" v-bind:data-id="item.Id" v-bind:true-value="item.ButtonType" v-bind:false-value="0" v-model="item.ButtonModel"/>
                                <span v-cloak>{{item.Name}}</span>
                            </label>
                            <div class="red">注：此处分配的权限是对于详细页面。列表页面权限一般包含：查看、新增、编辑、删除</div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">备注</label>
                        <div class="col-sm-8">
                            <textarea class="form-control" v-model="resource.Memo"></textarea>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>